$(document).on('tap click', "#user-list .weui-cell", function () {
    var openid = $(this).data('id');
    location.href = "/page/user-watch?openid=" + openid;
});

$(function () {
    $.ajax({
        type: "GET",
        url: "/user/get-all-user",
        crossDomain: true,
        success: function (result) {
            if (result.code === "0") {
                $("#user-list").append(tpl(document.getElementById('user-tpl').innerHTML, result.data));
            } else {
                $.toast.prototype.defaults.duration = 1000;//1秒
                $.toast(result.message, 'text');
            }
        },
        error: function () {
            $.toast.prototype.defaults.duration = 1000;//1秒
            $.toast("无网络", 'text');
        }
    });
});